package com.hyts.sdkhttp.domain;

import com.alibaba.fastjson.JSONObject;
import com.hyts.sdkhttp.constant.ContentType;

/**
 * project-name:iscloud
 * package-name:com.ultrapower.zq.domain
 * author:Libo/Alex
 * create-date:2018-03-12 9:52
 * copyright:libo-hyts-github
 * email:libo2dev@aliyun.com
 * description:此类主要用于: sdk 客户端请求操作响应服务类
 */
public final class SdkResponse {
	
	/**  
	 * @Fields field:field:相应编码  
	 */ 
	private int responseCode;

	/**  
	 * @Fields field:field:是否成功 
	 */ 
	private boolean isSuccess;
	
	/**  
	 * @Fields field:field:结果字符串  
	 */ 
	private String resultStr;

	/**  
	 * @Fields field:field:结果JSON对象  
	 */ 
	private JSONObject resultJson;
	
	
	private ContentType contentType;

	/**  
	 * @return responseCode  
	 */
	public int getResponseCode() {
		return responseCode;
	}

	/**  
	 */
	public void setResponseCode(int responseCode) {
		this.responseCode = responseCode;
	}

	/**  
	 * @return isSuccess  
	 */
	public boolean isSuccess() {
		return isSuccess;
	}

	/**  
	 */
	public void setSuccess(boolean isSuccess) {
		this.isSuccess = isSuccess;
	}

	/**  
	 * @return resultStr  
	 */
	public String getResultStr() {
		return resultStr;
	}

	/**  
	 */
	public void setResultStr(String resultStr) {
		this.resultStr = resultStr;
	}

	/**  
	 * @return resultJson  
	 */
	public JSONObject getResultJson() {
		return resultJson;
	}

	/**  
	 */
	public void setResultJson(JSONObject resultJson) {
		this.resultJson = resultJson;
	}

    /**  
     * @name contentType's getter method
     * @return contentType
     */
    public ContentType getContentType() {
        return contentType;
    }

    /**  
     * @name contentType's setter method
     * @param contentType
     * @return void
     */
    public void setContentType(ContentType contentType) {
        this.contentType = contentType;
    } 


    public JSONObject toJSON() {
        return JSONObject.parseObject(this.getResultStr());
    }

}
